<!DOCTYPE html>
<html>
<head>
    <title>filter的实现</title>
    <script src="../../src/array/filter.js"></script>
</head>
<body>
    <script>
        const arr = [1, 2, 3, 4, 5]
        const result = filter(arr, item => {
            // 取单数
            return item % 2 === 1
        })
        console.log(result) // [1, 3, 5]
    </script>
</body>
</html>